Skip to content

Conversation

@ajgarlag
Copy link

This will allow to run the test suite against Symfony 8. Once it's merged, I'll open a new PR to revert this one that should be merged before releasing a new minor version. See doctrine/orm#12110

Fix #1910

@ajgarlag
Copy link
Author

If we allow symfony/console:^8.0 or symfony/dependency-injection:^8.0 the phpunit execution fails with:

Run vendor/bin/phpunit --coverage-clover=coverage.xml
PHPUnit 12.4-dev by Sebastian Bergmann and contributors.

Runtime:       PHP 8.4.12 with PCOV 1.0.12
Configuration: /home/runner/work/DoctrineBundle/DoctrineBundle/phpunit.xml.dist

Fatal error: Premature end of PHP process when running Doctrine\Bundle\DoctrineBundle\Tests\BundleTest::testBuildCompilerPasses.
Error: Process completed with exit code 255.

See test

@dmaicher
Copy link
Contributor

dmaicher commented Sep 28, 2025

If we allow symfony/console:^8.0 or symfony/dependency-injection:^8.0 the phpunit execution fails with:

Yeah it fails due to

Fatal error: Declaration of Doctrine\Bundle\DoctrineBundle\Command\DropDatabaseDoctrineCommand::configure() must be compatible with Symfony\Component\Console\Command\Command::configure(): void in /var/www/DoctrineBundle/src/Command/DropDatabaseDoctrineCommand.php on line 33

and

Fatal error: Declaration of Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\EntityListenerPass::process(Symfony\Component\DependencyInjection\ContainerBuilder $container) must be compatible with Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process(Symfony\Component\DependencyInjection\ContainerBuilder $container): void in /var/www/DoctrineBundle/src/DependencyInjection/Compiler/EntityListenerPass.php on line 31

Fatal error: Declaration of Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\DbalSchemaFilterPass::process(Symfony\Component\DependencyInjection\ContainerBuilder $container) must be compatible with Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process(Symfony\Component\DependencyInjection\ContainerBuilder $container): void in /var/www/DoctrineBundle/src/DependencyInjection/Compiler/DbalSchemaFilterPass.php on line 22

Fatal error: Declaration of Doctrine\Bundle\DoctrineBundle\DependencyInjection\Compiler\CacheSchemaSubscriberPass::process(Symfony\Component\DependencyInjection\ContainerBuilder $container) must be compatible with Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process(Symfony\Component\DependencyInjection\ContainerBuilder $container): void in /var/www/DoctrineBundle/src/DependencyInjection/Compiler/CacheSchemaSubscriberPass.php on line 22

Fatal error: Declaration of Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface@anonymous::process(Symfony\Component\DependencyInjection\ContainerBuilder $container) must be compatible with Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process(Symfony\Component\DependencyInjection\ContainerBuilder $container): void in /var/www/DoctrineBundle/tests/DependencyInjection/Compiler/RemoveLoggingMiddlewarePassTest.php on line 49

It might be ok to update those signatures to add the native void return type? 🤔 all the classes are marked @final since a while already.

@ajgarlag
Copy link
Author

@dmaicher The Fatal error: Premature end of PHP process message with symfony/console:^8 and symfony/dependency-injection:^8 is not related to the void return type.

See: ajgarlag#2

@dmaicher
Copy link
Contributor

@dmaicher The Fatal error: Premature end of PHP process message with symfony/console:^8 and symfony/dependency-injection:^8 is not related to the void return type.

See: ajgarlag#2

Hm interesting. I tried it locally and I did not have any other error though 🤔

@ajgarlag
Copy link
Author

@dmaicher The Fatal error: Premature end of PHP process message with symfony/console:^8 and symfony/dependency-injection:^8 is not related to the void return type.
See: ajgarlag#2

Hm interesting. I tried it locally and I did not have any other error though 🤔

@dmaicher I've been able to reproduce it locally in a debug session executing:

vendor/bin/phpunit tests/RegistryTest.php --filter=testIdentityMapsStayConsistentAfterReset

The execution fails in vendor/composer/ClassLoader.php:576 when the file src/DependencyInjection/DoctrineExtension.php is included.

@greg0ire
Copy link
Member

PSA: I found yesterday that to get something more useful than Premature end of PHP Process, you need to set display_errors to On: sebastianbergmann/phpunit#6382

@greg0ire
Copy link
Member

greg0ire commented Oct 10, 2025

If we allow symfony/console:^8.0 or symfony/dependency-injection:^8.0 the phpunit execution fails with:

Let me try that on your branch, with the development ini file.

@greg0ire
Copy link
Member

And now you get the errors :)

@ajgarlag
Copy link
Author

@dmaicher The Fatal error: Premature end of PHP process message with symfony/console:^8 and symfony/dependency-injection:^8 is not related to the void return type.

See: ajgarlag#2

@dmaicher Sorry, you were right. Thanks to the changes introduced by @greg0ire, I have managed to resolve the errors related to the void return type.

@ajgarlag ajgarlag changed the base branch from 2.17.x to 3.1.x October 12, 2025 10:09
@dmaicher dmaicher added this to the 3.1.0 milestone Oct 12, 2025
* @return void
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why phpcs had nothing to say about this in 80bd103, but since the class is final and internal, it's not a breaking change to add it. 👍

@greg0ire greg0ire merged commit adc651c into doctrine:3.1.x Oct 12, 2025
12 checks passed
@greg0ire
Copy link
Member

Thanks @ajgarlag !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants